import factory.Factory;
import factory.Link;
import factory.Page;
import factory.Tray;

/**
 * @Author:DarknessShadow
 * @description:
 * @date 2020/5/14 16:07
 */
public class Main {

    public static void main(String[] args)throws Exception {
//        Factory factory = Factory.getFactory("listfactory.LinkFactory");
        Factory factory = Factory.getFactory("tablefactory.TableFactory");

        Link peple = factory.createLink("人民日报", "http://www.people.com.cn/");
        Link gmw = factory.createLink("光明日报", "http://www.gmw.cn/");

        Link us_yahoo = factory.createLink("Yahoo", "http://www.yahoo.com/");
        Link jp_yahoo = factory.createLink("Yahoo!japan", "http://www.yahoo.co.jp/");
        Link excite = factory.createLink("Excite", "http://www.excite.com/");
        Link google = factory.createLink("Google", "http://www.google.com/");

        Tray traynews = factory.createTray("日报");
        traynews.add(peple);
        traynews.add(gmw);

        Tray trayyahoo = factory.createTray("Yahoo!");
        trayyahoo.add(us_yahoo);
        trayyahoo.add(jp_yahoo);

        Tray traysearh = factory.createTray("检索引擎");
        traysearh.add(trayyahoo);
        traysearh.add(excite);
        traysearh.add(google);

        Page page = factory.createPage("LinkPage", "李姣");
        page.add(traynews);
        page.add(traysearh);
        page.output();

    }
}
